<!DOCTYPE html>
<html lang="en" class="no-js">

    <head>

        <meta charset="utf-8">
        <title>{:vae_get_config('webconfig.admin_title') ? vae_get_config('webconfig.admin_title') : 'vaeThink'}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <!-- CSS -->
        <link rel="stylesheet" href="/../plugin/stay/view/css/supersized.css">
        <link rel="stylesheet" href="/../plugin/stay/view/css/style.css">

        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

    </head>

    <body oncontextmenu="return false">

        <div class="page-container">
            <h1>{:vae_get_config('webconfig.admin_title') ? vae_get_config('webconfig.admin_title') : 'vaeThink'}</h1>
            <form action="" id="vaeyo-login">
				<div>
					<input type="text" name="username" class="username" placeholder="Username" autocomplete="off" value="vae" />
				</div>
                <div>
					<input type="password" name="password" class="password" placeholder="Password:vaethink" oncontextmenu="return false" onpaste="return false" />
                </div>
                <div>
	                <input type="search" name="captcha" placeholder="Code" autocomplete="off" style="width:140px;float: left;" />
			  		<img src="/captcha" class="input" height="37" width="198" id="captcha" onclick="this.src='/captcha?seed='+Math.random()" style="margin-left: 20px;margin-top: 17px;width:140px;display: block;float: left;border-radius: 6px;border: 1px solid rgba(255,255,255,.8);box-shadow: 0 2px 3px 0 rgba(0,0,0,.1) inset;">
			  	</div>
                <button id="submit" type="button">Sign in</button>
            </form>
            <div class="connect">
                <p>If we can only encounter each other rather than stay with each other,then I wish we had never encountered.</p>
				<p style="margin-top:20px;">如果只是遇见，不能停留，不如不遇见。</p>
            </div>
        </div>
		<div class="alert" style="display:none">
			<h2>消息</h2>
			<div class="alert_con">
				<p id="ts"></p>
				<p style="line-height:30px"><a class="btn">确定</a></p>
			</div>
		</div>

        <!-- Javascript -->
		<script src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
        <script src="/plugin/stay/view/js/supersized.3.2.7.min.js"></script>
        <script src="/plugin/stay/view/js/supersized-init.js"></script>
		<script>
		$(".btn").click(function(){
			is_hide();
		})
		var u = $("input[name=username]");
		var p = $("input[name=password]");
		$("#submit").live('click',function(){
			if(u.val() == '' || p.val() =='')
			{
				$("#ts").html("用户名或密码不能为空~");
				is_show();
				return false;
			}
			else{
				$.ajax({
	                url:"/admin/publicer/loginSubmit",
	                data:$('#vaeyo-login').serialize(),
	                type:'post',
	                async: false,
	                success:function(res) {
	                    $("#ts").html(res.msg);
						is_show();
	                    if(res.code === 1) {
	                        setTimeout(function() {
	                            location.href = "{:url('admin/index/index')}";
	                        }, 1500);
	                    } else {
	                        $('#captcha').click();
	                    }
	                }
	            })
			}
		});
		window.onload = function()
		{
			$(".connect p").eq(0).animate({"left":"0%"}, 600);
			$(".connect p").eq(1).animate({"left":"0%"}, 400);
		}
		function is_hide(){ $(".alert").animate({"top":"-40%"}, 300) }
		function is_show(){ $(".alert").show().animate({"top":"12%"}, 300) }
		</script>
    </body>

</html>

